Package com.cisco.pt.ipc.sim.impl
Class PortSecurityImpl
java.lang.Object
com.cisco.pt.ipc.impl.IPCObjectImpl
com.cisco.pt.ipc.sim.impl.ProcessImpl
com.cisco.pt.ipc.sim.impl.PortSecurityImpl
- All Implemented Interfaces:
IPCObject,PortSecurity,Process
Information provided by the PKI file:
\class PortSecurity
\brief PortSecurity handles and manipulates port security on switch ports.
\example network().getDevice("Switch0").getPort("FastEthernet0/1").getPortSecurity()
- Author:
- Auto-generated
-
Field Summary
Fields inherited from class com.cisco.pt.ipc.impl.IPCObjectImpl
accessMessage, ipcFactory, packetTracerSession -
Constructor Summary
ConstructorsConstructorDescriptionPortSecurityImpl(IPCFactory ipcFactory, PacketTracerSession packetTracerSession, IPCMessageLTV accessMessage) -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddSecureMacEntry(MACAddress macAddress, boolean isSticky) Information provided by the PKI file:Information provided by the PKI file:intInformation provided by the PKI file:getPort()Information provided by the PKI file:intInformation provided by the PKI file:intInformation provided by the PKI file:intInformation provided by the PKI file:booleanInformation provided by the PKI file:booleanInformation provided by the PKI file:booleanremoveSecureMacEntry(MACAddress macAddress) Information provided by the PKI file:booleansecureMacExist(MACAddress macAddress) Information provided by the PKI file:voidsetEnabled(boolean bEnable) Information provided by the PKI file:booleansetMaxMacNumber(int max) Information provided by the PKI file:voidsetStickyflag(boolean isSticky) Information provided by the PKI file:voidInformation provided by the PKI file:Methods inherited from class com.cisco.pt.ipc.sim.impl.ProcessImpl
getOwnerDeviceMethods inherited from class com.cisco.pt.ipc.impl.IPCObjectImpl
getAccessMessage, getClassName, getFactory, getObjectUUID, getPacketTracerSession, sendMessage, sendMessageWithReturn, translateToCommandStatusStringPairMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.cisco.pt.ipc.IPCObject
getAccessMessage, getClassName, getFactory, getObjectUUID, getPacketTracerSessionMethods inherited from interface com.cisco.pt.ipc.sim.Process
getOwnerDevice
-
Constructor Details
-
PortSecurityImpl
public PortSecurityImpl(IPCFactory ipcFactory, PacketTracerSession packetTracerSession, IPCMessageLTV accessMessage)
-
-
Method Details
-
isEnabled
public boolean isEnabled()Information provided by the PKI file:
\brief Returns true if port security is enabled, otherwise false. \return bool, true if port security is enabled, otherwise false.- Specified by:
isEnabledin interfacePortSecurity- Returns:
- boolean Returns a boolean
-
setEnabled
public void setEnabled(boolean bEnable) Information provided by the PKI file:
\brief Enables or disables port security. \param bEnable, true to enable port security, false to disable it.- Specified by:
setEnabledin interfacePortSecurity- Parameters:
bEnable- Takes in a parameter of bEnable
-
setMaxMacNumber
public boolean setMaxMacNumber(int max) Information provided by the PKI file:
\brief Sets the port security max-mac-count. \param max, the port security max-mac-count value. \return bool, true if successful, otherwise false.- Specified by:
setMaxMacNumberin interfacePortSecurity- Parameters:
max- Takes in a parameter of max- Returns:
- boolean Returns a boolean
-
getMaxMacNumber
public int getMaxMacNumber()Information provided by the PKI file:
\brief Returns the port security max-mac-count. \return int, the port security max-mac-count value.- Specified by:
getMaxMacNumberin interfacePortSecurity- Returns:
- int Returns a int
-
getTotalMac
public int getTotalMac()Information provided by the PKI file:
\brief Returns the total number of MAC addresses. \return int, the total number of MAC addresses.- Specified by:
getTotalMacin interfacePortSecurity- Returns:
- int Returns a int
-
getViolationCount
public int getViolationCount()Information provided by the PKI file:
\brief Returns the number of violations. \return int, the number of violations.- Specified by:
getViolationCountin interfacePortSecurity- Returns:
- int Returns a int
-
getLastSourceMacVlan
Information provided by the PKI file:
\brief Returns the last source MAC address and VLAN number. \return pair<mac, int>, the last source MAC address and VLAN number.- Specified by:
getLastSourceMacVlanin interfacePortSecurity- Returns:
- Pair<MACAddress, Integer> Returns a Pair<MACAddress, Integer>
-
setViolationMode
Information provided by the PKI file:
\brief Sets the violation mode. \param type, the violation mode. Violation modes: eShutdown = 0, eProtect = 1, eRestrict = 2- Specified by:
setViolationModein interfacePortSecurity- Parameters:
type- Takes in a parameter of type
-
addSecureMacEntry
Information provided by the PKI file:
\brief Adds a secure MAC address entry. \param macAddress, the MAC address to add. \param isSticky, true for sticky, false for not sticky. \return bool, true if successful, otherwise false.- Specified by:
addSecureMacEntryin interfacePortSecurity- Parameters:
macAddress- Takes in a parameter of macAddressisSticky- Takes in a parameter of isSticky- Returns:
- boolean Returns a boolean
-
removeSecureMacEntry
Information provided by the PKI file:
\brief Removes the specified secure MAC address entry. \param macAddress, the MAC address to remove. \return bool, true if successful, otherwise false.- Specified by:
removeSecureMacEntryin interfacePortSecurity- Parameters:
macAddress- Takes in a parameter of macAddress- Returns:
- boolean Returns a boolean
-
getSecureMacCount
public int getSecureMacCount()Information provided by the PKI file:
\brief Returns the number of secure MAC addresses. \return int, the number of secure MAC addresses.- Specified by:
getSecureMacCountin interfacePortSecurity- Returns:
- int Returns a int
-
secureMacExist
Information provided by the PKI file:
\brief Returns true if the specified secure MAC address exists, otherwise false. \param macAddress, the MAC address of interest. \return bool, true if the specified secure MAC address exists, otherwise false.- Specified by:
secureMacExistin interfacePortSecurity- Parameters:
macAddress- Takes in a parameter of macAddress- Returns:
- boolean Returns a boolean
-
getPort
Information provided by the PKI file:
\brief Returns the switch port. \return Port, the Port object.- Specified by:
getPortin interfacePortSecurity- Returns:
- Port Returns a Port
-
isStickyOn
public boolean isStickyOn()Information provided by the PKI file:
\brief Returns true if sticky is enabled, otherwise false. \return bool, true if sticky is enabled, otherwise false.- Specified by:
isStickyOnin interfacePortSecurity- Returns:
- boolean Returns a boolean
-
setStickyflag
public void setStickyflag(boolean isSticky) Information provided by the PKI file:
\brief Enables or disables sticky. \param isSticky, true to enable sticky, false to disable it.- Specified by:
setStickyflagin interfacePortSecurity- Parameters:
isSticky- Takes in a parameter of isSticky
-